package com.zf.operators.enums;


public enum OperatorsType {
	
	UNEQUAL("!="),
	EQUAL("=="),
	GREATER(">"),
	LESS("<"),
	GREATER_EQUAL(">="),
	LESS_EQUAL("<="),
	IN("in"),
	CONTAINS("contains");
	
	private String operator;

	public String getOperator() {
		return operator;
	}

	private OperatorsType(String operator) {
		this.operator = operator;
	}
	
	public static OperatorsType getOperatorType(String express){
		for (OperatorsType operatorsType : OperatorsType.values()) {
			if(express.indexOf(operatorsType.getOperator())!=-1){
				return operatorsType;
			}
		}
		return null;
	}
	
}
